package com.hxzy.controller.front;

import com.hxzy.common.core.domain.R;
import com.hxzy.common.core.domain.entity.SysDictData;
import com.hxzy.system.service.ISysDictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "前端通用字典查询")
@RestController
@RequestMapping(value = "/front")
public class FrontDictDataController {

    @Autowired
    private ISysDictDataService sysDictDataService;


    @ApiOperation(value = "根据类型查询值")
    @GetMapping(value = "/system/dict/data/type/{value}")
    public R selectByDictType(@PathVariable(value = "value") String dictType){
        List<SysDictData> sysDictData = this.sysDictDataService.selectByDictType(dictType);

        return R.okHasData(sysDictData);
    }


}
